Hamiltonian formulation of open WZW strings