centralizing functions

functions are all in 1 file, pages changed to index.php inside
directories that carry the name of the page