Added docs for CS scripts
Misc fixes and bug testing

Some things broke when porting, also found new bugs when in another
round of testing.