This is a subtask for #2.
@aacid Please review, especially the places which I marked with "?": "?", keys. Probably they are not needed.
"?": "?",