Refactor registry

PR https://github.com/oat-sa/tao-core/pull/75 should be integrated first