Starts to move parts of erod into erodlib and erodws.

The idea is to make the core of erod independent from any protocol.