Basic implementation of classes in JavaScript