fix memory calculation for cache insert decision, simplify drawing/rendering
pull latest base

contains fix/workaround for freeing memory used by MuPDF
Merge pull request #1144 from hwhw/master

Memory related fixes