Simple engine for 2d javascript canvas games