Improve if statement compatibility when checking for port mappings

Fixes #20
Refactor all conditional statements for improved compatibility
Don't show any output from `command`
Hide output from netcat port testing
Merge pull request #22 from alanpearce/bash-if-fix

Bash conditional fixes - looks good.