Revert "Organized namespaces, plus merged some of the code"

This reverts commit b0165617358663874a340b31b97346ee148db581.