tools, gendoc: Allow constants at module level; gen module index.

Addresses some issues from #585.
stmhal: Start of documentation for modos and modtime.
tools, gendoc: Put module TOC/index in module/ directory.
stmhal, pin: Simplify default value for alternate function init.
stmhal, pin: Save 140 bytes ROM by simplifying pin_print function.
moductypes: Remove debug inclusion of stdio.h .
py: mp_buffer_info_t::buf may be valid, but NULL for empty objects.

This happens for example for zero-size arrays. As .get_buffer() method now
has explicit return value, it's enough to distinguish success vs failure
of getting buffer.
objarray: Implement equality testing between arrays and other buffers.
tools, gendoc: Output small descr about module TOC.
stmhal: Add sys.platform string to PYBv1.0 (it's "pyboard").
doc: Document gc, sys, math, cmath.
doc: Fix up a few docs in sys module.
Merge branch 'master' into iabdalkader-cc3k-update