Many improvements!

Added commenting
Added tunnel/endpoint command line args
Minor style fixes