#1194: Add support for default argument values

Magic methods did not support default values for their arguments.
With this commit we improve the argument algorithm to detect, and
set, these and in the process make the algorithm more foolproof.
Merge pull request #1271 from mvriel/feature/1194

#1194: Add support for default argument values