Centralise ID validation and throw useful exception.
Merge pull request #446 from git-harry/sprint

Merged automatically by jenkins after successful gate test
whoami update.
fix tests for whoami.
Merge pull request #447 from git-harry/sprint

Merged automatically by jenkins after successful gate test