re-wrote some stuff in Coffee. Needs integration into grunt task