Refactor send javascript.
Merge pull request #12 from Ravenstine/send_refactor

Refactor send javascript.