Reworked Rakefile to use Rake itself correctly

The file tasks in the Rakefile weren't set up correctly, with target => source dependencies.
So I set that up and also refactored all the compilation out into two functions.
Add files for tests 1 and 2.