Extract helpers to clean the params

Also deal with facebook turning arrays into hashes