When it comes to nexus 5, the easiest way to do all those things in one program is to use wugfresh's toolkit. Search in XDA forums for it. Installs busy box, superuser, roots, unlocks bootloader and installs custom recovery (TWRP).
Via my LG Nexus 5...