first pass at upgrading to rails 4 with tests passing