Move test code into new testcode.rb file