Create form.js

Extracted javascript from controller in to jquery plugin to reduce 'boiler plate' js.