Quantum dynamics in the bosonic Josephson junction