use a temp directory and store downloaded data there

better to use a temp file that we have (presumably) exclusive control over, rather than trying to edit the target file in-place
then copy the temp file over the target, opening the target with mode 'w' so permissions/owners/etc are preserved
clean up event listeners

use once() for listeners that fire only once
use chain notation
grabbed the wrong logger functions
tryHttpDownload: debug temp path and final path
clarify working of getMediaAssets function

this function previously returned one result with side-effects on one of its arguments. now, both effects of the function are returned in an object with two properties. the obj argument is no longer rewritten, instead a modified deep copy is made. this is expressed in terms of a mapping function which is passed to a generic 'transformJson' function, which acts like an Array.map that can recurse into nested Object/Array structures.
Merge branch 'tfjson' into dltemp
debug-log some more stuff
oops, serverAcceptRanges was always being set to false
some libraries send their outgoing HTTP headers in proper letter case. do that i guess. i dunno
Fix Content-Range parsing

Regex groups were marked as non-capturing. Force of habit?
bingo, amazon doesn't support If-Range request header. Must use Range.
Version bump to 0.0.13

Retry and resume broken downloads
Reliability fixes