Added nginx to ninja; added test for samurai
Refactored code so its shorter.