Read logic trees from DB (instead of the filesystem)

Needed for the oq-engine-server https://bugs.launchpad.net/oq-engine/+bug/1206913.

Basically, when a job runs (starting from `pre_execute`), we cannot assume the oq-engine-server celery worker which processes the job has access to the same file system as the web server process. So, _everything_ needs to be loaded into the DB first, and everything needs to be read from that point on.