EHN: tidy up utils

all functions in misc.
Merge pull request #136 from pburdet/utils_tidy_up

EHN: tidy up utils