flashmap: Bring over changes from factory repo

fmap.py is identical to the one in factory/setup/fmap.py except:
 - no test functionality in main function
 - module docstring and license

Added some unit tests for the new functionality

TEST=ran unittests

Change-Id: Ib67bd4260cf4e1cc08543b822521a4adcf0cbce6
Reviewed-on: https://chromium-review.googlesource.com/516382
Commit-Ready: Drew Davenport <ddavenport@chromium.org>
Tested-by: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Drew Davenport <ddavenport@chromium.org>
2 files changed