Refactor code for multi-staged decision making
Currently has potentially four stages:
- Decide modality and required posts for context
- Decide appropriate function (go straight to 4 if required posts is 0)
- Decide parameters for function (if it has parameters)
- Execute function