Upgrade RSpec, Remove deprecations and some ruby warnings

Upgrade RSpec to the latest version, fixing deprecations along the way. Also fixing issues causing ruby warnings to be emitted.