Add database caching for Titanium applications.

Stores tiles in localStorage as well as in a database. The search order for tiles is; localStorage -> database -> server