Break install infrastructure server into smaller functions

Tests first!