Implemented the item slot for guns:
Make some gun members optional in json:

Remove entries from json that contain the default value.
Implemented the item slot for gunmods:
Make ammo_modifier of gunmods in json optional

And also remove other entries of gunmods that have the default value.
Make item::curammo private.
Bah, bad pointer. Use references instead of pointers.
Move exact ammo selecting function into player class.
Extract check for item being auxiliary gunmod into a function.
Move item::mode into item::item_vars.

Replace direct access with simple getter and setter functions,.

Move the next_mode function into the gun sections so all three functions are together and not lonely.
Move the "put item into inventory" code into a separate function.
Disentangle game::unload for containers:

Unload containers first, continue with guns / tools later.
Make unloading a gun generic, remove references to specific gunmods

Remove the check for specific gunmods, instead iterate over all mods of the gun and unload them via a recursive call.
Update player::rate_action_unload with the easier logic from game::unload

Make it take a const reference and be const itself.
Use used weapon (gun or gunmod) when crating casings with RELOAD_EJECT flag.

The item variable is checked in eject_casings (called from item::reload) with the gun / gunmod, so it already matches there.
Get skill of fired gun directly from used item, no special code for gun/gunmod.
Move common data of ammo/gun/gunmod into common data structure,

The common_gun_data is inherited by all three sructs and recoil is available in them.

Make the variable in npcmove.cpp signed because it's compared to the damage, which is now signed as well and this upsets the poor compiler.

Sideeffects:
islot_gun::dmg_bonus is no named damage.
islot_gunmod has indirectly a new member: pierce - gunmods could modify the piercing damage of the gun when fired (does not apply to bayonets!) - this will be display in the item info.
Add gun data to auxiliary gunmods and handle them as first class guns.

This removes the MODE_AUX flag from the gunmods and adds the gun data, taken from the gunmod.
The mods data is reset to default values that don't affect anything. The firing code and the functions in the item class use the gun data of the mod, they don't even need to know that the item is actually a gunmod.

recoil_add can now use the actually fired gun item, same with handle_gun_damage.

Needs preventing mods from being modded just like regular guns.
Restructure initial code in player::fire_gun:

First decide whether to fire a gun or a gun mod,
Then check for the CHARGE flag, this allows gun mods to have that flag and it allows charge guns to have active gunmods.
Adds a debugmsg for gun with no ammo.
Using item::set_curammo to let it do the magic of getting the correct it_ammo instance for us.
Moves the comment to where it makes sens.
Move more stuff that is modified by gunmods and exists in guns into a common structure.

Prevent display of aim_speed and sight_dispersion of mods when they are -1 and don't apply at all.
Add gun data entry to auxiliary gunmods to make them proper guns.

Someone needs to replace the placeholder data!

Remove the islot_gunmod::mod_dispersion, it was loaded from the json member "dispersion" which is now a member of the gun data and is now loaded through the gun data slot.
clip_size_modifier, range and ammo_modifier are both optional in gunmods and therefor removed, but added to the gun data where at least the ammo and the clip size are mandatory.