Add sector navigation to licence finder

Squashed commit of the following:

commit 920f199cabf140d62e317ca8f95123c0df46e337
Merge: ac6d174 aaa34ab
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 06:54:33 2012 -0700

    Merge remote branch 'refs/remotes/origin/master' into sector-navigation

commit ac6d1748a286c682a0ed5945c6df222e4280557d
Merge: 4e6635d 35648f5
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 06:54:13 2012 -0700

    Merge branch 'master' into sector-navigation

    Conflicts:
    	app/controllers/licence_finder_controller.rb

commit 4e6635dd011083f7362a3b69deb231bd12521446
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 04:41:00 2012 -0700

    Whitelist querystring parameters to clean up URLs

commit e3a4638e2ed033bb8e0f26b0a1c9fabed6e2fe2e
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 03:49:55 2012 -0700

    Delete useless error condition

commit 2b5ddd885a7c459f307b29aab2521855c4eee6a6
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 03:49:29 2012 -0700

    Allow adding of sectors via browsing page

commit f3b091633bb697abdab4b5cb148be0a801a96081
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 02:52:04 2012 -0700

    Better check for extracting GET params

commit 7e49c6247e8952490ded8cd19e8112a8455c42f5
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 02:47:35 2012 -0700

    Style fixes

commit f1955e57575cf302924fdf1ef6cce7c19a8eff9e
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 02:47:28 2012 -0700

    Generate correct "add" links when browsing sectors

commit 3f7c58645126074097bbe518741f6fc7c180069b
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 8 02:47:10 2012 -0700

    Fix case with createUrl and no params

commit fe998553ce26862c79273f27ff509da718a3f28f
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 09:04:13 2012 -0700

    Spec for adding sectors via browsing

commit 30018612a6b7ebf6878aaad6714d3e041836ca00
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 09:03:57 2012 -0700

    Make "on" handler for sector browsing better

commit b24615f8c7decb4e2706e5ecbc57d1545a34f7ce
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 08:48:36 2012 -0700

    Start adding integration tests for JS on sectors page

commit c1bf047e733d6cb8f5ffa7a56e43e4c0fffdf14e
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 08:28:59 2012 -0700

    More tests and better Ruby style

commit 489d538310ba0ab57dad388d1939ee35b787d5b3
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 08:12:53 2012 -0700

    Be more judicious about when to run JS tests

commit 960590ebd7ba8730bf6ebaa7b3fe055300652388
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 07:59:25 2012 -0700

    Add some Ajax integration tests for sector browsing

commit a3abeabbb20d4ec8306dedf4c94f942d12896abf
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 06:50:49 2012 -0700

    Add more tests for top level sectors

commit 773d912c351135a39095c63c7afac38b8526b06b
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 06:45:28 2012 -0700

    Controller tests for sector browsing

commit d73274a0cc1df006ded25e06aeb4d0b942320f43
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 06:07:13 2012 -0700

    Whitespace

commit 20bca58662b1188eb261e78e9f12c030a8993159
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 06:07:06 2012 -0700

    Allow adding sectors to the sidebar from the in-page browsing

commit a7612b969c74f21159379126afa29454bae09dd4
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 04:06:41 2012 -0700

    Fix Ruby idiom for no-arg function call

commit 2d43438ce4ab750f6926a2a865e0452a718504e5
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 04:00:02 2012 -0700

    Link to browse sectors page from search page

commit 0f352a5a7bbf07d411314258158e785b3be93f97
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 03:48:48 2012 -0700

    Remove commented out styles and correct indentation

commit 8f3273ce68355f9eb77d5c9eb2d8adf1edde5b5a
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 03:42:01 2012 -0700

    Change CSS to ERB to enable pre-processing

commit 1154cdb026e1926d3b11ced2a52a281ea3ba9c5d
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 03:22:58 2012 -0700

    Re-jig search results page to have tighter styles

commit 8c0f8ed634eb2ad2f9338d9b1ecb3e371d5f2752
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 03:03:47 2012 -0700

    Add a label to the sectors search box

commit 339b130cfc3f70409472bdaad535fee9ad86eec0
Merge: a3aeb08 a7c3b85
Author: Rob Young <rob.young@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 10:37:35 2012 +0100

    Merge branch 'master' into sector-navigation

    Fixed conflict around counting how many sectors were saved.

    Conflicts:
    	lib/data_importer/sectors.rb

commit a3aeb0870c2cc304ba960c7a4065cda6df381618
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 02:16:25 2012 -0700

    Rename function to something useful

commit 6469d288a8f0c048b086a84b843cda4ad6875b8e
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Thu Jun 7 01:50:09 2012 -0700

    Automatically expand and contract lists on click

commit 02af976777f0085ff493615535583f72b62f96cc
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 09:21:25 2012 -0700

    Clean up siblings of the top level list

commit abffea4e48a52960d0ce97866d7ecf8a696efbe8
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 08:53:15 2012 -0700

    Allow Ajax opening of links

    TODO: need to clean up siblings etc. so things actually collapse

commit 72db55e5d6ab4ace72582d57130dd8f90241de70
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 08:15:53 2012 -0700

    Include @data-public-id in links

commit 9abb8f4b82460f3240fd189c7dd575f1e80f735a
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 08:15:40 2012 -0700

    Guarantee valid JSON and loop order

commit 41a164555d9d6f529f08ab3976029b2a6afe04e3
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 07:27:02 2012 -0700

    Include public ID in "open" nodes

commit 045fc6f20fe873eb1cfeb22fb3e8b701e441c93f
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 07:26:18 2012 -0700

    Show lists of sectors as JSON

commit 962c177af6b8b9d5256d63694514264e7c30600e
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 06:40:59 2012 -0700

    Switch to using an ID as it's more stable for jQuery "on"

commit 83b522f2c004ce165b90106547dc15ad8c9371cd
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 06:29:58 2012 -0700

    Include application JS when rendering sector browser

commit 449abf65e9b43dcf47622e4703108a92829a155e
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 06:29:44 2012 -0700

    Make sure we use development static files

commit bbc8452579a9b82e826fc2f61dd9bc54a2baff47
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 06:23:05 2012 -0700

    Style and JSLint fixes to Javascript

commit cceefb6b1899f8f3b718d3b7490c183e97ef3d1a
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 05:49:46 2012 -0700

    Change browsing interface to be a list of lists, allowing for drill down/up

commit 684c23efe44309caf5e924b0e38ad021b4d44af1
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 02:53:32 2012 -0700

    Allow linking to browse index from templates

commit b12e991781a0f0347cefe8e5706d7dfdb43a412f
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 02:38:35 2012 -0700

    Refactor templates into an include

commit 1f69baed40ae8a13cd2fb6b7f6680ed2d4775641
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Wed Jun 6 01:53:49 2012 -0700

    Remove example data - we're using Mongo

commit 793c4f855997dbd1cb0c6fca862e5a1e794af4ee
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 1 09:10:34 2012 -0700

    Add rudimentary sector browsing functionality

commit 0ba19ce6f154d7689778f0536e98b32698c14d8f
Author: Rob Young <rob.young@digital.cabinet-office.gov.uk>
Date:   Fri Jun 1 16:25:00 2012 +0100

    Update model to support hierarchical navigation

commit 38d513bd27a007dd4456e50ba5409e51ffec374f
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 1 08:07:40 2012 -0700

    Add example data and start reading it out from the sample data

commit e8b489041dce2a9955e85adb4f6a76047a582d33
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 1 08:07:26 2012 -0700

    Fix filters (this needs refactoring)

commit 3cfb93ed01281e66f6043336376fc144f2cab46c
Author: Bradley Wright <bradley.wright@digital.cabinet-office.gov.uk>
Date:   Fri Jun 1 07:09:08 2012 -0700

    Initial routes and non-functional controllers for sector navigation