[CORE] Move the built-in modules aggregation from array type to linked list.

For some architectures, linker adds a few bytes of padding after each
module linked in the module table. This breaks the current implementation
of built-in module table parsing and module initialization. This patch
now aggregates the list of modules into a linked list and then sorts
the linked list.

This is a revised patched with some beautification from Anup Patel.

Signed-off-by: Anup Patel <anup@brainfault.org>