Initial add of the generic optimizer code

Before digging into this code, look at the Rules implemented at the bottom of DagOptimizer.

There are several TODOS here:

- [x] After I split the code into separate files, I started hitting a scala 2.9 compiler bug, that I don't hit in 2.10. I'll try to work around, or possibly hope that Twitter finally gets on 2.9 before we need this.

- [x] Tests tests tests. I played around at the repl, but clearly we need super hardcore tests for any optimization framework.

- [ ] Actually call this code from an existing platform.
Actually, give we have the type parameter on + (and could add it back on k if we wanted), we could have another map which could store the Class files. When we add a new one, our equality can also compare the type information.

It's definitely a bit of overhead, but this isn't really latency sensitive code. Could help get rid of weird errors. There might be other ways as well...