Block Models of Lithosphere Dynamics: Approach and Algorithms