A simple utility function for defining classes in JavaScript