database class and tablesorter plugin

* moved database connection and tasks code to separate class -
database.php
* added tablesorter jquery plugin with pagination component
* added jquery migration script to support tablesorter plugin