Revert "Move native code to library"

This reverts commit 971a9f516555eed75ee3c89b9f1234ba907598b4.