Create goal.js

No globals other than g() & secure (no extra args, no abilities to change the process
Update goal.js

Bug fix & renaming
Merge pull request #160 from Lcfvs/patch-1

Create goal.js