Finding split pairs and split components, finding maximum planarity subgraph, some code refactoring