extract ExternalKind from ErlModel
move cache to separate package
more model reorganizing, extract services and stuff