Add SQL helper function for formatting file permissions
Add --download option and simple libcurl wrapper