Moving stuff over from the lib.
Fixing namespaces.