Refactored entity lib

Signed-off-by: Tom Wright <tom@inflatablecookie.com>
Refactored policy lib

Signed-off-by: Tom Wright <tom@inflatablecookie.com>
Fixed mesh ref in user manager

Signed-off-by: Tom Wright <tom@inflatablecookie.com>