Added caching mechanism.

This should eliminate some uneccessary traffic on the serial API.