logging code.
some changes by me, including misc. cleanup, minor bug fixes, and brand-new access control list code.