Add mixin for fd factories, move fd tests to util.