Text this: From optimal control problems to foliations, some kinds of multifoliations and relations to generalised jets