rebuilt with better OO design
various improvements in rewrite
fixed merge conflict, updated unnecessary jQuery to pure javascript