First rough pass at filtering upload url and path on doc-specific basis
Proof of concept for serving files from URL param
Adds notes
Tests improvements

- Introduces BP_Docs_TestCase
- Introduces test for bp_docs_is_existing_doc()
In bp_docs_is_existing_doc(), bail if $wp_query is empty

This is important in case the function is called before init.
Merge branch '1.3.x' into 1.4.x
Redirect more intelligently when can't associate with groups

This makes the tests run properly without getting headers already sent messages
Improves user setup in tests
Filename checks
Avoid php warning
Run bp_docs_taxonomy setup at bp_docs_init, to make sure it's run in time during tests
Improved filename_is_safe()
Show Permissions section even when groups not enabled
More filename_is_safe() work
Refactor test bootstrap to use BP tests
Removes bp-factory, which is now loaded from BP tests suite
Improves attachment download headers and security
.htaccess autogeneration
Filter upload dir even for non-private docs

If you don't do this, it's going to result in huge headaches when the Docs
change their privacy settings
Adds basic support for auto-drafts and attachment moving on publication