Replace the host matching with manual website based matching

The host matching has an issue when the URLs are rebuilt [1].
This patch completely removes host matching and falls back to the
matching being done manually.

Add caching to the url_adapter creation

[1] https://github.com/mitsuhiko/werkzeug/issues/488
Cleanup imports

This patch moves all the imports that were dispersed around
the codebase to the top of the file. This was not possible
in previous versions which loaded the backend automatically
before the configuration was updated from a file.

This may require prior configuration of Tryton in your
application WSGI script