Introducing namespaces, init.php and minor improvements in code