Modernise gem packaging, remove warnings

This just brings a few bits and pieces up to date (use bundler for gem packaging,
upgrade RSpec version) and then removes warnings.