Start to pull settings into a context struct

Move settings that are related to forwarding into a new struct context
type, to make it easier to test forwarding functionality. Perform a bit
of cleanup while we're at it, and introduce the ability to set an upper
limit on the memory consumption of reflectd.