Made a JS class out of the initial code

This is a proposal of the new StandaLock API code in OOP style. It has a few new ideas ^^
I'll be happy to discuss them with u.