Start refactoring the go engine

- The current implementation is a left over
  from a compiled coffee script version.

  We need to update it to a more readable
  and maintainable javascript code,
  and then actually rethink and refactor
  the entire engine from scratch.