Revert "Move native code to library"

This reverts commit cfcdc646062585bafe01127d165705d6f21451de.