The Theory of Hardy's Z-Function