build: module: Add archive and link sequence

What we did in this commit was build a little state machine which keeps
track of how far into the build process the module is.

Because all the lists and stuff which can be referenced by multiple
threads are threadsafe, no locks are needed.

In order to get to the linking phase all of the dependencies need to
have finished their build phases.

Because of the way this works, the system is actually capable of
compiling more than one module at once. This can result in a compiler
working on a file of module A, while another thread is finishing up the
work for module B.

Not having to wait on other modules, before moving on to the next one
should be a speed up over the previous design of waiting for the module
to compile and link, then move on to the next one.

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>