options: add support for headers in options

also return xhr object
refactor: changed internals a lot, somewhere else, no commit message