Allow tilde in resource name, like in puppet

tilde character is allowed in the resource and tag names in puppet, but not in puppetdb.
This PR fixes this.