raise error if public methods are called before register.
refactor test suite

run tests with ruby test/test_helper.rb