Re-implemented the close loop to ensure beforeClose and isAllowClose is called for all closing drawers. Tuned the test cases. Added copyright notices and javadoc.