Improve startup order of EMQX applications. Simplify build scripts and improve code reuse.