Namespaces everywhere. Added missing documentation on new functions.