Improve APC mode.

- Check that APC is actually enabled.
- Do not store apc cache for cli mode.
- Make useAPC static property public to allow it to be explicitly
  enabled or disabled.