improved teamhandling and support player removal
restructured code into modules and functions