Various things + integrated BarAPI

Various touch ups and changes, and completely fused BarAPI code into
ours.