Fixed Bug related to redirects

TODO: rewrite the controller tests to be able to check the location headers
Fixed bug in query string generation for read()

Added test to cover situation
Merge branch 'refs/heads/dev-2.0' into cake2.0