allow references to be done with some whitespace.
refactoring a bit to resolve pattern location whether in local cloudlet or referenced, and cleaner use of API in CLI code.