Fix errors caused by the api change

Move isFile/isDirectory into the prototype too.