RESTful API improvements

This pull request includes many changes:
* PEP8 / conventions (yes, I'm kind of a standards nazi ^^).
* no longer reset a task's options before starting a scan, as this was making the `option_set()` function useless.
* data returned by the API is more coherent, instead of returning an error, it returns JSON with an error message. All data returned by successful queries now also has a `success` field set to `true`.
* the `download` endpoint now returns the file's content base64-encoded in a JSON object (for consitency with other endpoints).
* global variables are no longer used, a "storage" class is used instead (using `global` is dirty).
* More logging (for each successful/failed query), also include the taskid everytime

Feel free to request changes/improvements if needed.