Moved Refinery module code to lib/refinery.rb

WIP - wanting CI