Bug fixes for formal-object-ancestor labeling for formal objects in Preface/Introduction

Bug fixes for formal-object-ancestor labeling for formal objects in Preface/Introduction; see #168.

Also refactored some of formal-object-labeling code.