Adds anon function and flags in cache

Creates an new map cache to store information about method containing the code
of anonymous functions, and method flags.
With tests.

Fixes #1001001