refactor the whole app using OO-PHP

split more UI-agnostic functions into separate classes;
deleted the JavaScript version;
updated copyright statements;
truly valid HTML5 (datasets for AngularJS attributes)