Only stripping leading and trailing whitespace from location

Even though whitespace inside the location hash might not be a good idea, it works and therefore it should be allowed.

Consider the following route:
#/search/:query

With the following location hash:
#/search/this is a test

Before this patch:
query="thisisatest"

After this patch:
query="this is a test"