Implemented caching vian the wordpress Transient API. Removed messy debug code.