Simplified code
When relevant, add an entry ".." pointing to the parent directory
Use 2 different colors to render odd / even rows