WIP introduce namespaces; move all global functions and variables to classes