Fixes/improvements to IMAP cache query script
Revert "configswitch doesn't output integer values, so explicitly cast to integer just in case"

This reverts commit cc8faa8a5051833798e9fe93051069cad19e70dc.
Correct way of not quoting configswitch values
Set these default values to 1 week

For max_time - now that we regenerate ID every 6 hours (currently),
session fixation is less of an issue. This is now more to trap issues
such as upgrades that cause data to be stored in session to be invalid
and to ensure that users are logged out eventually in order to have any
login tasks performed.

For static cached JS/CSS lifetime, this is really there to limit old
files and as an occasiionally freshening of the cache to ensure that
data is correct.
[mms] Add IMAP cache specific purge action to the imap cache query script.
Fix updating existing metadata fields.
Optimizations to storing cached metadata

Use shorter field identifiers.
Split search cache ID field out into separate field to distinguish from
search IDs.
No need to check uidvalidity when storing data - this only matters when
retrieving.
Don't store uidvalidity value if it isn't present