Tamtweaks

Hi John, I've merged in all your changes fixed a couple of minor glitches, and did a bunch of other stuff so it'll work against the live database.
Care to try pulling all my changes back over into your repo? (this will bring your github repo back into sync with mine, and from there you can pull it back down onto your local repo for any further work)