r7818: add argument processing using #\=, big refactoring, more tests added and passed