improved sqlite rotation; added rspec testing