Make all decoding function return a status and check that status wherever they are called

This lets me remove one more assert _and_ it also lets me add some more checks
for bad data.