Move Formula.factory into new Formulary module

Starting work on #17936 - is this the correct direction so far?