A class-y approach to writing JavaScript