Intuitionist type theory and the free topos