Added data caching. Closes #1