complete rewrite to match grunt contrib style and grunt 0.4.0 support