add firmware upload to C++ codebase, reorganize files