Full Javascript OO and inheritance on plugin frontend code