Whitespace and tidy up.
Improve repository querying.
Add more tests.
Update mechanism to activate/deactivate interfaces.