Charset option for creating plain passwords

Adds option to specify character set for creating plain passwords. I generalized asquelt's code for shellsafe option.

Current options are 'alphanumeric', 'special_shellsafe' (asquelt's shellsafe shars) and undef/default (original behavior).
Usually it would be nice to have changes like these in a seperate commit, as this makes it easier to spot where you actually changed anything and where you only introduced cosmetic changes.