PlugNPlay exceptions should be in a namespace

Fixes #246
Don't lexical cast with two numeric types

boost::numeric_cast would be appropriate here. But we have already done
range-checking.