moved all classes into namespaces

- replaced all 'function' with 'public function'
- replaced all 'var' with 'public'
- removed PHP file close tag from class files