Added interfaces and modified main() to allow for CLI or GUI. CLI not yet tested.