Collect more memory statistics

This implements RFC https://github.com/micropython/micropython/issues/5 . For configurability, this implements RFC https://github.com/micropython/micropython/issues/35 . Please let me know if you'd like anything changed before merging (including names of files, identifiers, defines).