Refactor plangre.js for an easy browserfy