Add rails4 support

* do a few conditional checks for rails 4 structure changes
* move gems used for developoment and testing to Gemfile
** (to allow using git url, and to try a new strategy of specifying development gems)