small restructure. removed bad code.

load functions are now stored in hibernatecontext.
removed some bad code
cleaned up some code