Added comments, unit test coverage and autodiscovery support.