Moved all functionality to functionality.py, which will act as the new nexus of functionality, leaving main.py free for actually connecting and such.