Add tests for typeof evaluation
Fix typeof evaluation for regex and function