finished JSLint reformatting and better functional object pattern