Added javascript init options

Added "before" option to enable function to be performed before
launching menu (and possibly cancel it)
Also added "target" option for specifying target menu
Updated javascript init
Merge pull request #19 from jhubble/master

before and target javascript options