Implement fromList function for trees

Also make trees an instance of the monoid type class.