code cosmetics (replaced variables w, M, t with more meaningful ones)
added grunt uglify, minified version
added licence etc.
formatting