Fixed some scoping concerns and put the library evaluation callback in the correct location (library evaluated rather than source loaded)