Cosmic ray spectrum and composition from three years of IceTop and IceCube