Since the code is based on the Ruby implementation we use CoffeeScript's class
which is a little bit difficult to write in pure JavaScript.
Take a look at the existing tags
to see how to implement them.