Change factories to use Alchemy configuration.

Fixes #669.