updating dependencies
more refactoring and restructuring

The api should now be less likely to allow invalid usage