Refactor protocol into subpackage

This will allow easier handling of mocked inverter connections.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>