Re-enabled dynamic ports for web apps.
Added support for #ENVIRONMENT in bin/build.