Removed get-password-or-apikey function, changed argument evaluation order.
adding tests ... needs refactoring to be true "unit" tests
trying to merge changes