Linking flow

First part of going towards a better linker. Support for including runnable code in packages (#598) follows separately.