foo.type() and tests
Merge branches 'f_type' and 'master'