Folder handling for static content

Also added additional comments