major refactoring. now featuring more object oriented code, data-attribu...

...tes, comments and jsdocs