Slowly refactoring script with new store system and D.R.Y.

I doubt this will build, which is fine. I'm still working on it. :smiley: