Add count_objects functionality to segc

This patch adds the functionality brought from count_objects to the
segc binary and sets up the structure for the remainder of the
project.