Referrals functionality ongoing

Fixed bug in front-end when searching, CRUD for facilities and other UI issues. Added tests, permissions  #114