Fully dynamic planarity testing with applications