Bug 724632 - Refactor registry to remove legacy APIs

This is based of two other pull request #671 and #677 so diff will contain changes from those two. Diff will no longer include them once they land.