Moved some code from index.php into Config and library files
Added unit testing for build time