stmhal: Reimplement file support using stream protocol API.

This adds readline(), readall(), etc. methods. Also other fixes to make
Python API compliant and "with" support.
stmhal: #undef log2f if it's defined.
stmhal: Add powf, logf, log2f, log10f.
stmhal: Fix raw REPL so that it passes through more ASCII chars.
tools: pyboard.py can now execute a file remotely!
stmhal: On soft reset, if in raw REPL mode, don't run main.py.
tools: Improve reading back from pyboard.
tests: Allow to run tests on pyboard.

To run the tests on the pyboard you need to set the "test_on_pyboard"
variable to "True", and also have tools/pyboard.py available for import
(easiest is to symlink to it).
Merge pull request #419 from pfalcon/stmhal-file-streams

stmhal: Reimplement file support using stream protocol API.
stmhal: Add home/end cursor support in readline.

Home/end work in picocom and screen (different codes in those 2
programs).  Also, CTRL-A (for non-empty liny) and CTRL-E act as
home/end.
Changes to get unix/ port compiling on Cygwin.
py: Handle small int power overflow correctly.
Add the git version to the banner
Implements most of str.modulo

The alternate form for floating point doesn't work yet.
The %(name)s form doesn't work yet.
tests/file-with: Add testcase which failed for @dpgeorge.

Works on x86.
py: Add m_malloc_fail function to handle memory allocation error.

A malloc/realloc fail now throws MemoryError.
py: This time, real proper overflow checking of small int power.

Previous overflow test was inadequate.
tests: Make rge-sm.py use less memory (integration step increased).

In addition to memory allocation failure, other problem was that 10**17
was overflowing.  Now passes.
py: Enable optimisation of multiplying 2 small ints in compiler.
Merge pull request #422 from dhylands/str-modulo

Str modulo