Unit test overhaul

OK, I think I'm more or less done.

I've done a lot of changes to the way the unit tests are run, take a look at the commits, I hope I explained things well enough. If you don't like anything I've done, please let me know (some things are a matter of taste). In any case everything feels much cleaner and more isolated...

The only thing I'm not 100% sure about is the creation of the functions inside every test that needs them. It might be OK to create a standard function or two (just like we create the "data" table), but for now I just left it like that...

After this I will start looking at the improved support for TransactionScope.