Added support for long tags.

The previous version of the library dod not process tag numbers greater
than 30 correctly, which caused desynchronization of the input stream and
lead to other decoding errors on many real world ASN.1 structures.

This patch introduces a new function for decoding long tag values, and
contains refactorings to handle greater tag numbers correctly.