Clean up cb script

Add xserver check and some other stuff.
Merge branch 'master' into grapefruit