Fixed buf in valid var test --
Reinstated unit test to script build --
Moved remaining functionality out to main lib --

This needs to be worked on.  At present it is just old stuff, and not even
usable as yet.