Reimplement native library loading