refactored unit aggregation
added unit api
separated logic loop from graphics loop
added structure unit