Review and cleanup of build-release

- Correctly determine the release queue in case of special releases.
- Various clean ups and simplification of the program flow.