Fix rack/railties gem depdencies and versions.

Fixes runtime gem version conflict when running Jasmine tests.
Code formatting/cleanup.