bugfix for message completion
adding error handling
moving some declarations to fix scope issues when exceptions are caught
correctly marshall the cdata to pystrings
fix the building of sd
connecting the remainder of the old tests
test changes and a bit of cleanup