added new tests, implemetned entity manager in lua