Add the code for the second stage bootloader

This commit adds the second binary that is responsible for checking if
the application firmware is correct and based on this pass the control
to either the application or the third stage bootloader. The code for
that is still incomplete and this is only a skeleton of the intended
implementation.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Update and improve documentation

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Move ancillary code to lib/, remove unused headers

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