PTFM-11707: make dxpy constructors throw errors on bad IDs

Also refactor the methods to streamline ID verification and other common
get and set methods.