added ability to 'rake test'. restructured tests.