Refactored enqueue_script
Merge pull request #181 from VarunAgw/js-refactor

Refactor enqueue_script.