Add canonicalization support
Add tests for canonicalize