Got [some of] the unit tests working independent from Magento

Although the code has been used outside of Magento, the unit tests have
not been run outside of Magento until now. A lot still fail but about
half pass now.