Refactor Hamiltonian.

Refactor evaluation and derivative computation behavior.
Generally clean up the class.
Refactor example.

Add "simple_pendulum_problem()" as a separate example so as
to clean up the __main__() block.