Consolidated changes from core

Cleaned up deprecated code, put cache in the appropriate place, use Statamic's parser.