Throw exceptions when parsing invalid BERT

Rather than simply assert()ing (and hence abort()ing) when an attempt
is made to parse invalid BERT, it is more convenient to throw an
exception; the caller can catch this if desired, otherwise the
behaviour will be broadly similer.

In parse.hpp, rather than silently accepting malformed tuples, throw
an exception there too.