Make canonicalize() more flexible.
Add support for writing (canonical) SMILES.