Ensure __and__/__or__ of PYSON is always boolean

issue4187
review9731002
(grafted from be0d97713666acd24354171459f047626dcf9f3d)

--HG--
branch : 3.0
extra : source : be0d97713666acd24354171459f047626dcf9f3d
Fix typo in table name for ir.module

issue3951
review14531002
(grafted from 4f84d05df50edac101321b175fe33e40ecfc35b3)

--HG--
branch : 3.0
extra : source : 4f84d05df50edac101321b175fe33e40ecfc35b3