Added library system, better FunctionRefType resolving, makefiles