Adding a simple caching mechanism to the parsed annotations

These changes don't have tests because their functionality will be replaced by
a third party annotation parser with cache support.