Interim commit: refactoring and polishing around varchar encodings