RF: refactor library copying in tests

Move library copying into own function.
WIP: working on delocator API