Python connections

Moved the connection stuff to its own file, and made stuff actually connect. Maybe.