Changed map handler to entity handler so that the API could become richer.
Added entity factory generation and usage to the framework