Add basic ASN.1 parser tests

This commit also includes fixes for bugs found while writing these tests