Moved delay before timeout. Added form.$pending and input.$pending. Set input to pristine when cleared.