Quasilocal Hamiltonians in general relativity