Rails4 fixes

I have merged the master branch and added `momentjs-rails` as dependency.
This is the way the rails 4 branch works for me.