Case instead of if, no more VARCHAR support.

Replacing big if statement with case, dropping VARCHAR support.