Prevent writing to it_comest data during play.

The item data must only be written when loading it from json, later it is constant and must not be changed.
Remove unused variables.
Remove unused struct items_location_and_chance

along with the file it's in.
Remove unused function inventory::has_artifact_with
Remove unused function is_edible
Move artifact enumerations into enums.h

This allows including only that header and not the artifact.h header.
The artifact header includes the itype.h header, which is thereby included in nearly all source files.
Move enum item_cat enum to enums.h

So inventory.h can use it without including itype.h (it does not need to know what itype is).
Move morale_point::name into player.cpp

Remove the parameter morale_data[], it can be used directly inside of player.cpp
Move Item_factory::nname into item class
Move Item_factory::count_by_charges into item class

Remove the redundant logic in item::count_by_charges, instead use the virtual function of itype.
Move saving artifacts into artifact.cpp

Because the loading is done there, too.
Add item::type_is_defined to check for existing item type

The function is a simple wrapper around Item_factory::has_template().

As it can be used without including item_factory.h, removes including of
item_factory.h from various files.
Remove direct access to itype via item_controller with indirect access via class item.

savegame_json.cpp: the type is already known, it's this->type, established some lines above via make(idtmp).
Move item_category into item.cpp

To avoid the need to include item_factory.h
Move item spawn functions into item_group.h

vehicle.cpp: changed birthday to be 0 instead of current turn, to be consistent with the other item spawn calls.

item_factory.cpp: debug_spawn remains there, to big to be moved.

Also moves the include of "item.h" into the source file.
Replace spawning of butchered CBMs with map::put_items_from_loc

See mapgen.cpp, it creates the items from the group via item_group::create_from_group (which for a distribution creates one item only) and adds them to the map.

Note that item group type distribution is the default anyway, so adding it to the json does not actually change it, but makes it more obvious.
Replace map::put_items_from with map::put_items_from_loc

The additional parameters for quantity, charges, damlevel and rand are used nowhere (always given as 0).

The only advantage was the num parameter which was used only once and can be applied be the caller instead.

Use map::put_items_from_loc from monster::drop_items_on_death as it does
the same thing as the previous code there.

Same in map::place_items
Move the duplicated item spawn code in npc into separate functions.

Use item_group::item_from instead of id_from and check for item::is_null instead of EMPTY_GROUP_ITEM_ID.
Use item_group::item_from in npc.cpp to get a random item directly.

This removes the last usage of item_group::id_from and item_group::EMPTY_GROUP_ITEM_ID, both are removed as well.
Add documentation to map::place_items

Use the turn parameter.