refactor configureHook

This commit splits configureHook into smaller functions, and makes
sure to avoid any C-style string manipulation (instead preferring
C++ manipulators)
fix leaking the SR handle in configureHook if portsConfig() returns false
major cleanup (untested)

 - separate the different hooks in separate method (generally
   one method per bus subsystem, i.e. digital in, digital out
   and UART)
 - use C++ string manipulation
 - remove the unproven, untested and probably not workable
   time-sharing method for the UARTs. The currently implemented
   method could never ensure that communication coming from the
   serial line could not be lost.
 - use the port_name / wport_name convention used by e.g. the CAN
   module
 - properly handle failure to configure
 - read the digital I/Os using the global pin reading functions
   instead of doing it one-by-one