refactored ref attachments code; added SaleLine entity
added support for ArrayField