Reorganization, part 1
Reorganization, part 2
Reorganization, part 3
Big cleanup, and commenting, on main .js file
SQL and PHP scripts for logging data for both templates