Added tests for checkboxes.
Refactored methods to better suit qunit tests.
Moving code around for easy debug.