some separation of concerns with php- MVC implementation

also included is the bug-train