The REST handling code does not set the 'rest' context before initPlugin is done, so a plugin has no way of knowing if the current context is a REST call or not.
Added option to initialise contexts in new TWiki; added the context ids for the scripts in the right places. Both
command_line+ and =rest
should be inited in intPlugin calls now.