Dynamic Algorithms for Shortest Paths and Matching