Listing port defined in env variable

Server listen port can now be defined in environment variables (useful for Heroku, CloudBees, cloud9), fallback to 8080

Smaller code improvements