Script expansion

I think the branch is mature enough to merge back in to master