deduplicate --elements; add argument handling test cases; minor style/documentation changes