Rails 4 compatibility

Fixes #104 

Tested js with rails 3.2.20 and 4.1.7, tested rake tasks, no test suite so not sure what else I should test?