Consider number of available instances in deas before starting app.

This change set allows users to take advantage of the available instances capability in dea and limit the number app instances spawned per dea.

improved test cases for available instances plus additional scrubbing on code alignments