Geometry and dynamics of surface homeomorphisms