Improve error handling and create functional tests

Fixes #13
Support throwing error on missing item data

Add option to throw error when item is undefined.

Fixes #15
Set resolved (cached) data only if value is found

Fixes #14