Fix hyphenated ID decoding

This pull request adds tests for `DecodeString()` and fixes hyphenated ID decoding to avoid an index out-of-bounds panic.

@jrconlin r?
Actually, the error condition should be handled first, then the non-error doesn't need to be in the if statement at all since the nil case panics.

Related to that, panic should be considered a "all hope is lost, shut down". Is this truly panic worthy?