This gets the basics functional again

The resolves a number of fatal errors but the module is still not fully functional. It will take quite a bit more work from here.