Add FIRM constructor prototype with tests

This is again a bit of infrastructure work, but I hope tests will become easier after this ...