simple entity system using a functional approach