Improved url canonicalization and expression generator

This now follows Google's spec. Now it passes all the tests defined in their python reference.