SSL: Moved storage for several extensions to the session.

This is simplify later API changes.
SSL.session: Added select_cipher_suite().

This API change allows for selecting the cipher suite from
multiple criteria (eg certificate availability, SNL, etc).

The current implementation does not take advantage of this (yet).
internal_select_client_certificate is broken for everything but RSA. Added a bunch of FIXMEs and some cleanup.
A few simplifications.
Crypto.CTR: Fixed some warnings in the fallback code.
Compiler: Fix scope name for inherit ::this_program.

The scope name for inherits using ::this_program used to
be "this_program", which caused the "this_program::"-scope
to refer to the inherit rather than to the current class.

The scope now instead gets its name from the name of the current class.

Also fixes Crypto.CTR.State, which triggered the problem.
Standards.X509: Added sign_tbs().

This provides a simple way of (re-)signing a TBSCertificate.
Standards.X509: Use sign_tbs() in sign_key().

Clean up the code in sign_key() by using the new sign_tbs().

Also some Autodoc markup adjustments.
Open all files in binary mode, on platforms where this is meaningful
Standards.ASN1.TBSCertificate: Implement the ASN.1 API.

The TBSCertificate class is now a Standards.ASN1.Types.Sequence
that has been extended with some accessors and verifiers. It can
now be used just like any other Standards.ASN1.Types.* class.
Standards.X509.TBSCertificate: Fixed infinite loop.

`der() called get_der(), which starts by gets the value of
the der variable, looping ensued.