ScalaEntityManager and context for higher order functions

provide access to the ScalaEntityManager wrapper and added higher order functions with current context as input