Write output to file rather than stdout > file.

Sometimes LLVM gets cranky when trying to output instrumented IR to stdout rather than a proper file. Unfortunately llvm::raw_fd_ostream::~raw_fd_ostream() doesn't say what's wrong, but we can work around it by just using real files (which is what we're trying to do anyway).
Oops: expect bar() to be called bar, not foo!
Slightly more elegant usage of StringMap.

llvm::StringMap helpfully defines a lookup() method that saves us from doing STL-style iterator comparison.
Add operator==(const FunctionRef& x 2).

Create (and use) an equality operator for FunctionRef.

The fact that we previously weren't comparing function names in operator==(const FunctionEvent& x 2) was causing test failures; remove the failure markings now!
Add more tests (that pass!).