Handle issues decoding openid requests more gracefully

Clean up some pep8/pylint violations as well

LMS-16
LMS-23

@brianhw @sarina