Arbeits- und Wärmefluktuationen in Zweizustandssystemen: ein trajektorienthermodynamischer Formalismus