Better EnvironTag validation

Implemented a few suggestions from http://reviews.vapour.ws/r/96/:
 - Added validation of the EnvironTag on the API connection.
 - Better checks in tests comparing EnvironTags.