Add a generic style for non-core titlebox tabs

Rudder needs a background for the titlebox tabs to look nice
and the standard RT ticket metadata all have colors. Add a
generic color for use by extensions and non-core titleboxes
as a default. Extensions can still override with a different
class and a stylesheet.
Add more bullet-proofing to upgrade steps

This builds on the work in 04d58ea6.  During an upgrade, it's common to
restore from your backup without clearing out the current database,
meaning tables are left behind and cause errors when we try to create
them again.

As noted previously, DROP TABLE IF EXISTS is painful on Oracle, so we
don't bother jumping through hoops.

The Pg steps are simpler here than in 04d58ea6 because the ids are
declared as type SERIAL so Pg auto-manages dropping/creating the
sequences for us.
Switch to a portable implementation of `id -gn`

The ouput of `groups` may not list the primary group first -- and while
`id -gn` works in most Unix-like platforms, it does not work on Solaris.
Re-implement it using $PERL, for portability.
Avoid a race condition in crypt testing

Test::Warn fails us here because it only captures the first line of a
multi-line warning.  Opening up the debug log and searching over it
leads to race conditions, as the error we're looking for may not have
been flushed to disk by the time we read it.

Instead, use a simple __WARN__ handler to look for the desired warning.
Add the (new in 4.2) ObjectScrips table

Also re-point templates (which now look up on Name).
fix uninitialized warning if $txn->Field isn't set
allow to include js files from directories other than /static/js

this is initially for /static/RichText/ckeditor.js, which we want to include
in the default JSFiles so the rich messagebox could be always available.
add $Type to %ARGS so we can specify the type of the textarea in the caller

by default, the type is controlled by the system config($MessageBoxRichText)
and user preferences. however, sometimes we want to explicitly set the type no
matter what system config or the user preference is.

this is initially for the IPs and Addresses textareas in RTIR's ScriptedAction
tool page(/RTIR/Tools/ScriptedAction.html), where rich texts are not useful at
all(actually harmful as the backend doesn't handle the rich format).
Merge branch '4.2/time-worked-history-uninit-warning' into 4.2-trunk
Merge branch '4.2/test-crypt-race-condition' into 4.2-trunk
Minor doc patch to avoid confusion
Remove old mailgate info from RT 2.1
Fix doc typo
Add means for plugins to wrap the PSGI app with their own arbitrary logic
Remove ambiguity of "substitute ... for ..." in $CanonicalizeEmailAddressMatch

The phrase "substitute x for y" can be read to either mean "substitute
occurrences of x for y" (leaving y in the finished string) or
"substitute x for occurrences of y" (leaving x in the finished string).
Reword to use less ambiguous phrasing, and link more explicitly to to
CanonicalizeEmailAddress for overriding, in case of more complex
canonicalization.
Add tests for PSGIWrap API
Merge branch '4.2/message-box-type' into 4.2-trunk
Merge branch '4.2/add-generic-titlebox-style' into 4.2-trunk
Merge branch '4.2/drop-more-if-exists' into 4.2-trunk
Merge branch '4.2/psgi-wrap-for-plugins' into 4.2-trunk