Miscellaneous libfoundation fixes

This gets libfoundation building cleanly on Linux again, and also changes a bit of TypeInfo API to make working with static initialisers more convenient.