stat.go: Improvement

* Split the program into smaller functions, added the dereference flag, and now prints more than just directories and files.