Text this: A theoretical framework for simulating systemic risk and its application to analysis of the banking system