Simplify type signatures of functions in dynamic_lib

Realized that the generic type can itself be a reference to a concrete type. Don't need to require the file name parameter to be a reference.