Refactored the firmware build system.