chdman mono/linux fixes and improvements

This is a series of patches that get chdman bits working under mono/linux, plus some general chdman related improvements.