Add lots of missing buildin functions and fix case-insensitivity for __ constants