New FactSystem

This is a replacement for Pull #1081. I couldn't get that one to rebase without going haywire.