Allow static files in Collections

Allow StaticFiles in Collections alongside Documents. Attempts to fix #2555, #2598. Can also be modified a bit to accommodate #2592. Builds on #2603.

Please test!
Can this be cached or something? Or set on read? This method hits the file system every time it's called, which is sucky.