Master router, packet handling changes

Begun implementation of master router
Rewritten some packet handling code
Fixed config file for master router