using update + value

if invalidate is true and update is true, the cache will be set to the "value" parameter.
Why? invalidate is expensive - a new database access must be done to get the new cache value.
If we already have the object instance, we don't need to invalidate it. We just set it in the "value" parameter, saving a database hit.
Better docstring
Merge pull request #4 from jbastos/master

Added value parameter