URL encoding spaces when using the PHP-only version of the UriTemplate expander. Closes #371