Move native code to library