build: split gyp build into separate libraries