Added principal scope filters and sample coloring

The main five types of scopes I am going to distinguish are these:

  * primary mainline scope
      the scope that directly contains the cursor

  * secondary mainline scopes
      the scopes that indirectly contains the cursor, i.e., the ones
      which directly contain a primary or secondary mainline scope

  * offside scopes
      non-mainline scopes, further distinguished by inner nesting levels

  * adjacent scopes
      the scopes that are adjacent to one of the cursors

  * inconsistent scopes
      scopes for which the left and right brackets do not match
Fixed a peculiarity with bisect_left
Cleanup and cosmetical renamings

Fewer private functions, consistent naming, etc.