Trade, Law and Order, and Political Liberties: Theory and Application to English Medieval Boroughs