Use reference cache for Communities and ASes

These two type of objects get reused over and over again, so it makes
sense to actually use refcaching on them.

Change-Id: I9c63ab23cdf0480055e7a868a73107c4ac9926ff
Signed-off-by: Robert Varga <rovarga@cisco.com>