Update .gitignore
Rename isType() to isValidType()
Fix code style and typos, add docblocks