avoid PHP warnings when PHP is in picky mode
use encodeURIComponent() when building URLs to escape characters like + in +xml properly
make test output easier to understand
encoding URL components correctly, adding some more tests
fixed PHP syntax error in resources.php
fixing further PHP syntax errors and nitpick warnings in authentication.php