Added recursive namespaces to functions, and defined loading order, so that we can set up dependencies