Broke main php file into includes.  Added comments and formatting.  Ω

Changed some input handling.