api: module: support loading arguments from file

API is not well-thought, feel free to recommend improvements

Cherry-picked from !412 (merged). Can be front-ported to next.

Merge request reports