[task/namespaces] Update the code to use namespaces (untested)

This is initial work on making the code work with namespaces but isn't tested.
Note that tests will need to be reworked (see: https://github.com/phpbb-extensions/test-framework) so I sort of partially did them.

I may have missed or messed up something, so let me know if you see anything.

This should be merged AFTER #70.