py: Take gc_pool_start out of bss section, to reclaim 1st block of heap.
py: Fix compiling of nested while/for and exception handler.

Addresses issue #912.
py: Add more debug printing code in gc_dump_alloc_table.
tests: Add test for nested while with exc and break.
py: Simplify compilation of elif blocks.
py: Add more compiler optimisations for constant if/while conditions.
modure: Update to re1.5 v0.6.1, fixed and extended character class support.
py: Improve stream_read so it doesn't need to alloc 2 bits of heap.
unix: Make -c option parse input script as a file, as per CPython.

Addresses issue #915.
unix, stmhal: Implement file.readinto() method.

Also, usocket.readinto(). Known issue is that .readinto() should be available
only for binary files, but micropython uses single method table for both
binary and text files.
tools, pyboard.py: Allow exec argument to be bytes or str.
py: Partially fix viper multi-comparison; add test for it.
examples: Update conwaylife to work with new LCD API.
stmhal: Add retry to SD card init.

This fixed an issue with a certain SD card sometimes not initialising
first time round.  See issue #822 for related, and thanks to
@iabdalkader for the idea.
stmhal: Set entry point for ELF binary debugging

When loading the ELF binary to the board with a debugger, the debugger
needs to know at which point to start executing the code. Currently the
entry point defaults to the start of the .text section.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Implement kwargs for builtin open() and _io.FileIO

This makes open() and _io.FileIO() more CPython compliant.
The mode kwarg is fully iplemented.
The encoding kwarg is allowed but not implemented; mainly to allow
the tests to specify encoding for CPython, see #874
Use mode/encoding kwargs in io and unicode tests

mode argument is used to assert it works
encoding argument is used to make sure CPython uses the correct encoding
as it does not automatically use utf-8
Merge pull request #922 from swegener/for-upstream

stmhal: Set entry point for ELF binary debugging
py: Make mp_const_empty_bytes globally available.
stmhal: Overhaul UART class to use read/write, and improve it.

UART object now uses a stream-like interface: read, readall, readline,
readinto, readchar, write, writechar.

Timeouts are configured when the UART object is initialised, using
timeout and timeout_char keyword args.

The object includes optional read buffering, using interrupts.  You can set
the buffer size dynamically using read_buf_len keyword arg.  A size of 0
disables buffering.