Use ArrayBuffer instead of object array as LUTs,

Also use only positive indexes. This results in 6-10x speedups.
Use Int16Array intead of ArrayBuffer.
Allow already downloaded images to be cached.
Merge branch 'unPromises'