converted to coffeescript, moved drawing tool logic into a class shared by both server and client

with this new design, interesting drawing tools can easily be added
without any duplicated logic