A bit of code cleanup here and there all-around.
app_terminal.py:  Added policy_share_terminal() which will be used by terminal_policies() to determine whether or not a user is allowed to share terminals.  This is controlled via the 'share_terminals' setting.
app_terminal.py:  Fixed a bug where dtach'd terminals were being killed when gateone.py ended.  Also added a 'kill_dtach' keyword argument to kill_session() so that it will be possible to kill dtach'd sessions via logic that might be added later (e.g. admin interface).
app_terminal.py:  Continued work on terminal sharing.