Template'ize Dominoes

This makes a bit of an awful mess of the code, but gets rid of casting
and buys use typesafety. I thought about mixing subclassing and templates
but then my brain broke a little bit.

On the plus side, you can define new dominoes with struct syntax.