`Smart' self-avoiding trails and the collapse of chain polymers in three dimensions