Javascript classes replaced by coffescript-style class definition.

See http://coffeescript.org/#classes