Better tests
Added support for registeration and created tests for it.