Refactoring

Changed this from a simple Click emulator into something semi-powerful!