Split off resource gathering from RES generation.
Build fix + optimise string tokenization.