Vortex phases and glassy dynamics in the highly anisotropic superconductor HgBa2CuO4+δ