Update tern to 1.3.1