Simplified code by replacing if-else with selector

This makes the code easier to browse and understand
Make UsePAM configurable

Previously it has always been disabled. This caused problems with
Ubuntu 12.04 where some initialization is done via login/pam. If
both UseLogin and UsePAM are disabled, this initialization cannot
be performed resulting in strange messages about missing locales
and subsequent crashes/warnings in apps like command line completion,
apt, command-not-found (this is what I've noticed).
Merge pull request #13 from kurthuwig/pam_and_code_simplification

Code simplification and optional PAM support