Fixes to some javascript problems and to some indexing problems. Basic outline of restriction configuration.