Port old DFU code to the new codebase

This commit partially ports the old DFU implementation code to the
code of the milliboot. For now only firmware uploading is supported.

Singed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>