Fixed event handlers and added tests

- further improved homepage
- added PHP test script (functional test)
- fixed the event handler methods (data access)