Bugfixes, code cleanup, new scripts

Lots of little tweaks & code cleanups.
4 new scripts, see Readme.md for info.
2 scripts removed, 1 script renamed.