Cleaned up and added tests for collation support.

Cleaned up and added tests for collation support.