Restore database wrapper class and getNamespaces() for Labs

No Toolserver DB for namespaces, so use API instead. Rename
functions to CamelCase