Sir James Montgomery, 1st Baronet — Advocate, judge, politician, agriculturalist and landowner