Titular Title Generator
By Measter
Thanks to fivex for the assistance with scripting.

Features:
 - Creates higher titular titles for every landed duchy and kingdom. The lower tier title is required to create the title (e.g. to create the Kingdom of Leinster, you would need the Duchy of Leinster as your primary title.)
 - Ability to use an existing mod as a base to create new titles, and creates an addon for it.
 - Can choose to only generate kingdoms or empires.
 - Can output short names. For example: Leinsterian Kingdom instead of Kingdom of Leinster. English only.
 - Selectable culture restrictions:
    - None: No cultural restrictions. A character of any culture can create the title.
    - Culture: To create the Kingdom of Leinster, your character would need to be Irish.
	- Culture Group: To create the Kingdom of Leinster, your character would have to be Irish, Scottish, Welsh, or Breton to create it.
 - Selectable religion restrictions:
   - None: No religios restrictions. A character of any religion can create the title.
   - Religion: To create the Kingdom of Leinster, your character would have to be Catholic, or a heresy of Catholic to create it.
   - Religion Group: To create the Kingdom of Leinster, your character would have to be Christian to create it.
 - Selectable lower-tier-title requirements:
   - Duchies: To create a kingdom, you would need this number of duchy titles (minimum of 2).
   - Kingdoms: To create an empire, you would need this number of kingdom titles (minimum of 2).
 - Can make new titles de jure liege of currently held titles.
   - Replace De Jure Unchecked: You create the Kingdom of Leinster with the Duchies of Munster and Leinster, both remain de jure Kingdom of Ireland.
   - Replace De Jure Checked: You create the Kingdom of Leinster with the Duchies of Munster and Leinster, both are new de jure Kingdom of Leinster.
   
Changelog:

Version 1.2
 - Now supports CK2 1.06.
 - Option to generate only kingdoms or only empires.

Version 1.1.8
 - Removed copy feature in favour of dependant addon.
 - Fixed incorrect logging messages.
 - Fixed bug causing crash when the program is closed if logging isn't enabled.

Version 1.1.7
 - Fixed bug causing an ArgumentException when reading provinces.
 - Fixed bug where colour values were out of bounds.
 - Fixed bug when a from_dynasty_prefix in a culture is a blank string.
 - Fixed bug causing an error if a county title doesn't have a related province file.
 - Fixed bug preventing the log file being written if an exception is thrown.

Version 1.1.6
 - Added logging feature to assist with debugging.

Version 1.1.5
 - Fixed short names of empires generated from existing kingdoms being called kingdoms, not empires.

Version 1.1.4
 - Fixed missing '=' in generated titles.
 - Rewrote parsers to be better.
 - Added outputting of short names.

Version 1.1.3
 - Removed the culture and religion from the title definition, because it was limiting who could create the title.

Version 1.1.2
 - Fixed bug causing a crash if the Culture setting on the PC does not use a '.' as a decimal seperator.

Version 1.1.1
 - Generated titles can now be usurped without holding the capital.
 - Generated titles that have been destroyed will no longer add new de jure duchies when recreated.

Version 1.1
 - Fixed bug causing the program to crash if there are no mods installed in CK2.
 - Fixed bug causing tags in allow brackets to be read incorrectly as title stats.
 - Fixed bug in which the landed_titles.txt file wasn't replaced when run on vanilla.
 - Titles now become de jure vassals of new titles.

Version 1.0.1
 - Clamped colour values to the expected range.
 - Handled cases where there is a county level title without a matching province file.
 - Fixed bug where the program will fail if Copy was checked but Use Mod is not.
 - Fixed a bug in the file/directory selection code which caused files to be place/modified outside of the mod directory.