Added test framework.

Does this actually write to the filesystem? We need to make sure that errors are propagated here correctly, if the user doesn't have the right to write there. Also running multiple tests in parallel would probably break it? Maybe the cleaner solution is to use a safe temporary variable for that?