Added some qunit tests, and implemented stronger enforcement for locked panels