Moved logic out of rackup file, added basic mini tests