Basic main loop integration + Map Shifting

Perform some basic integration of the socket code into the main loop and
add map shifting functionality