Port of Ryan Bates' rubywarrior to coffee-script/java-script