https://developers.google.com/android/nexus/images
Download the stock image for the razor device, and wipe your device using the fastboot commands listed above. To flash the image:
fastboot flash system system.img
This will return your device back to the factory state. I'm not sure if it relock the bootloader as well, but I don't think so. Simply reflash the recovery, and you're good to go. If the recovery shows 0mb for the internal memory available space, use fastboot to flash the stock img, and boot into recovery again and do a factory reset. I think that would be the correct way to do it.