Fix caching mix in directive parsing

The directive parsing code was never using its cache.  The value type
was different between the store and load operations causing it to miss
every time.  Switched to a named key to prevent future confusion and
added a unit test

closes #1366