also add tests
prior to this cahnge emqx node shutdown is done by init:stop which might have undesired stop order of the applications in this change, emqx_machine_terminator is added to stop apps in defined order and then terminate the node in infinite loop
make use of application dependency to ensure start order. also the same dependency top-sorted for shutdown and reboot order