converted to OO, added libraries so not cdn dependant during development