Added lua attribute to get faction->idx as an faction id

__Background:__ I needed some unique "id" for factions to use as keys in Lua-tables that contain faction specific information, like the crime record of the player, etc.

I looked into the faction-code, and if I'm not way off, this looks like it's doing what I want.

I know, "factions will be remade, and thrown out", etc. But until/even at that point, there should be a Lua method for getting some unique id for a faction, to be used in this way, instead of using the faction name as key (which is how I solved it until this PR).

I guess as long as factions aren't remade the id will not change for a faction. If it were to change then a save bump would be needed I guess.

Putting this for review, since I'm not sure about the validity of what I've done.