First cleanup passover. Renamed with clicc_homepage prefix, moved PHP functions to another file which the modules includes, removed switch statement, formatted indentations and added comments to be much more readable.