gc improvement: use both depth-first and breadth-first marking

mark depth-first up to some limit, and queue objects after that. this
avoids copying long arrays of pointers into the mark queue, which can
waste a lot of memory. I also managed to flatten most of the marking
into a single function, which seems to make marking faster in general.
document detach and ignorestatus. closes #2785
Export detach
document some more process functions and update helpdb
closes #1921
add some missing function documentation
Merge pull request #3768 from simonster/export-detach

Export detach
Merge github.com:JuliaLang/julia