Reworked the code to work with ruby 1.9.3 and Sequel 4.4.0