Better TCO for case statements

@garyb 

Resolves #325