Added segment query

Added segment query functions and renamed bb query to be consistent with chipmunk api