Refactor the code about gist file inputs.

DRYed up gist form view and made scripts for gist file forms unobtrusive.