pipicpowerd.c separate common routines

The functions logmessage.c, writecmd.c, readdata.c and testi2c.c are now in
separate files. The same routines are used by pipicswd.c and pipichbd.c.