Non-working appcache support; some code cleanup