A Macro-Finance Model of the Term Structure