Adds basic hook loading and some refactoring
Adds unit tests
Updates lib