Progress towards cleaning up ASN.1 APIs.

- Use native representation for ASN.1 objects as much as possible.
- Make validator capture format more flexible.
- Use buffers to replace binary strings, etc.