splitted statemanager into state and bindingmanager, added gl state managing, lots of refactoring