Add component tests
Add javadoc and refactor transition handling