You can solve both these issues with an application called BootUnlocker. With the app, you can unlock and relock your Nexus 5’s bootloader right from your device and without wiping your data. In addition, you can reset the ‘tamper flag’ within the app. In order to use BootUnlocker, you need root access on your device. Once you gain root access (use an exploit such as TowelRoot for it), install the app from Play Store, run it and tap Unlock/Lock button.
For newbies: It is virtually impossible to flash a custom ROM, install a custom recovery like CWM or TWRP, or apps that require root access without unlocking the bootloader of your Android device (except Samsung Android devices). By unlocking bootloader, anyone with the proper skills can modify and enhance their Android phone. BootUnlocker can be downloaded free from the Play Store for free