Correct rst syntax errors

This removes a bunch of errors when generating the api docs.
The list of directives are moved over to rst_epilog which will be added
to the end of all generated rst files, so we can address these directives
over the whole source tree.

Change-Id: I485dcbc04a6e3f75f01a429793e28b33dbe61982