moved main() function down to HAL and replaced with our own application entry point. This will make targeting other platforms like FreeRTOS easier.