Improve validation and target construction

* Separate errors for nonexistent and invalid pages
* Add checks for external targets where forbidden in validation
* Improve target construction
* Other minor changes
* Simplify MassMessage::normalizeTargets()

Change-Id: Ie9a9497b874707e0484e6533f1a683c7abe19c35