Refactor DiscoveryService to remove start/stop from it.
Don't hang on AM when stopping.
Checkstyle fixes and javadocs improvement.
Release external resource on stop.