Bring back rails 3.0 support and some small cleanup