Renamed examples/ to testdata/
collation API refactoring and bugfixes.

added test cases to collation API.
validate collation API using tools/validate/