Move the creation of the whitelist to the constructor

Extracting the switch statement into the function map did allow for one
additional optimization: creating the whitelist from the keys in the
function map. This ties together the two things that should be in
lockstep anyway, simplifying the code and making it more robust at the
same time.