Improved discovery management.
Added some basic message passing infrastructure.