Re-order config options and update comments

This also moves the code block for python applications back to the
right place.