split cbar.cpp into cbar.cpp and cbar_main.cpp