Refactor javascript; completely remove jQuery dependency.