Introducing UI namespace and cleaning up JS and index.php