test and fix js in patterns dir; add gruntfile