Initial type constraint support.

This supports a number of scenarios with generic type constraints.

One are it doesn't support is multiple generic constraints against the same type. I have it spitting out multiple types but only the first one is active, the rest are behind a TODO: comment. #8