Reimplement folder layout as a C++ view

The javascript implementation was slow and limiting, so this reimplementation
does more or less the same thing but is able to be much more efficient and,
eventually, much more powerful. Speed is dramatically improved, and scrolling
support is added already.