Moves some classes to namespaces and some simple cleanup

Change-Id: I40e289979fd1d69ccb502828f4401760f1ae872b