Cleaned up the xhr image loader needed when running as a chrome app, and implemented a cache