added support for metadata field to PandoraEntity.
extended test, add findSource, several renames of local variables