Introduce table namespaces

Solves #138.

Also updates some tests and fixes an issue with theme records not unserializing properly.