Cache now uses an Entry object
Combine isexpired ismissing into one.
Remove flush pattern and make cache flush by default on exit
Layers have longer expiry (default 1 day)

If capabilities is out of date then old layers can still be used.
No need to rename image files

Just use format parameter in PIL.Image.save()
Simplify json dump encoder
Remove urlretrieve()/jsonretrieve() and replace with get()

urlcache.get() now returns a file object similar to urlopen()