Complete overhaul of base file

Rewritten to give more flexibility in use. Also made a mess of code, so I'll need to go back and clean up / add comments / etc. later.
Extended and working!

Overhauled main code for more flexibility. Rewritten readme. Wahoo.