Add service function to manage media

 * Udpate the readme
 * Add unique constraint on AssociatedMedia on hash and media_id column
 * Add some tests