Separator based sparsification I: planarity testing and minimum spanning trees