Change dependencies to be rails4 compatible

I have this branch working within a Rails4 (beta1) app. This change allows to use rails4 with mercury.