sourcedr: Add new features and reorganize code

Test: ./sourcedr/functional_tests.py
Change-Id: I805ffda3068ca8f82300f6d479683afe1e004973
9 files changed