Updated framework

Updated the source to use the new framework, added a few more hooks and
some other stuff.