LIFE SUPPORT
   Wastes from humans and livestock are sent to an anaerobic digester.  This will generate methane that must be dealt with. I suggest  pumping it to fuel cells for extra energy. The fuel cells will produce CO2 and H2O that will be cycled back to oxygen by algae and crops.  The electricty is used to heat the wet oxidizer.  After anaerobic digestion, some of the waste and other gases like ammonia and hydrogen sulfide are sent to a wet oxidizer or SCWO (super critical water oxidizer) using the Zimmerman process. This device is basically just a metal tank into which sewage and oxygen at high pressure are pumped.  Heat is applied and the waste materials react with the oxygen and give off heat to sustain the oxidation reactions.  The resultant water, CO2, nitrates and mineral salts are fed to the crops and algae which feeds the fish.  Some of the algae is harvested and mixed with soil to provide organic matter and preformed carbohydrate for worms and mushrooms grown in dark chambers.  Worms are fed to chickens that yeild eggs and meat. Fish, crabs, shrimp, clams and lobsters will be raised in tanks or ponds.  Some water rich in organic wastes from the fish ponds can be sent to the compost chamber..  Wastes from the fish are also sent to the wet oxidizer to make pure sterile fertilizer.  Alfalfa is grown for some sheep to supply milk, mutton and wool. Naturally, sheep and chicken manure  is sent to the wet oxidizer and/or the compost chamber. Butcher shop scraps from the fish, chicken, pigs or sheep will not be fed to the animals.  This could lead to strange prion diseases like Mad Cow syndrome.  Some scraps will be sent to the compost chamber and some to the anaerobic digester  and then to the wet oxidizer and broken down into nutrients for the fast growing algae which provides lots of feed.  Since algae can double its mass four times a day we can produce plenty of it from a small water tank or pond. Plenty of rice, corn, wheat, fruits, veggies and potatoes will be grown.
  It is important to see that much food is passed through our guts undigested.  Vegetable matter is about 30% indigestible cellulose. Some starches pass through our small intestines undisgested and reach the colon where bacteria feed on them and give us gas.

The digested and absorbed food is burned to CO2 in our cells and exhaled in our breath.  This allows a symbiotic relationship between animals and oxygen producing plants.

The solid material that is excreted cannot simply be buried or carbon will be lost from the loop.  If something is not done with it our closed ecological life support biosystem will fail.  Anaerobic digestion by bacteria will supply methane to fuel cells that will release CO2 back to the plants.  The wet oxidizer will burn carbon bearing materials in liquid and solid waste to CO2 that will be returned to the plants.  Plants convert CO2 to sugar molecules  which are then combined to form starches, cellulose and other molecules composing plant tissue.  Composting is simple, but it will not return carbon to the plants, because they don't absorb carbon from the soil through the roots.  They only absorb it from the air through the leaves.  Composting also generates foul gases.  The wet oxidizer is vital to CELSS (Closed Ecological Life Support System) success.

In nature, fungi and bacteria break down manure as well as dead plants and animals and generate CO2.  We must burn some of that waste from anaerobic digestion of manure and urine and methane also to generate CO2.  Methane from compost chambers where chaffe, digested waste and animal scraps decompose must also be burnt to CO2. Fuel cells will be the best way to burn CH4 to CO2 and H2O.
Drinking water straight from the wet oxidizer even after purification is psychologically unappealing.  That water will be piped to algae ponds and fish ponds and into the soil crops are planted in.  Water will evaporate from the ponds and it will be transpired into the air by crops.  Humans and livestock will exhale and perspire moisture into the air too.  Moisture from worm farm soil and mushrooms will also evaporate into the air.  Moisture will be condensed from filtered air (to remove dust) and purified by filtration and sterilized with heat and pressure (to kill spores and bacteria) and even by adding a little ozone to the water.  Water will be stored in tanks and pumped to water faucets in kitchens and cabins for drinking and cooking.  It will also be piped to the livestock watering troughs, ponds and sprinklers for the crops. 

Wash water from bath tubs, sinks and washing machines will also be purified and recycled in separate circuits. As we consume water condensed from the air and pour some down the sink drains, and as we excrete water into the  circuit leading to the digestors and SCWO, water  might accumulate in those circuits.  We can get it back in the air with decorative fountains that spray water into the air after it has been purified.  This will provide the desired psyhcological isolation from devices full of manure and urine.
Photosynthesis.  See how plants can burn some of their glucose for energy with oxygen and generate CO2 and H2O yet have some left for animals to eat in their plant tissue consisting of chains of glucose molecules called polysaccharides.

Basically, the plants make enough oxygen for themselves and the animals that feed on them.  For every glucose molecule 6 O2 molecules form and the plants consume X number of those O2 molecules leaving 6 minus X  O2 molecules for the animals.

If the plant dies the CO2 goes into the ground with the dead plant and is released slowly by decay.  Old wood and paper into landfills sinks CO2.  Undigested waste from animals also goes into the ground and sinks CO2.  In space we will decompose undigested waste in anaerobic digestors, and burn it and the gases it generates in fuel cells  and in super critical water oxidizers to keep CO2 in the recycling loop.
Before entering cryo units H2O is condensed out
Last but not least, humans will need sundry items like razor blades and soap.  We can make razor blades from steel because it takes a fine edge.  Soap can be made from lye combined with vegetable oils or animal fats. Lye (NaOH) is made by electrolysis of water solutions of NaCl or just by adding H2O to sodium in a chamber that can handle to release of hot hydrogen and potential mini-explostion when Na metal reacts with H2O.  We can shave with soap if no cream. Lye soap can be mixed with salt and it will separate into soap (salt cake) and glycerin that can be used for lotions.  Women will like fragarances made by water or alcohol extracts from flowers.  Stockings? Either we make nylon in a chemical lab or we raise silk worms.  Combs could be made of metal.  Needles made of steel.  Thread? Will we grow cotton or is hemp good enough?  We'll need bandages too and lady's sanitary napkins. So we might really need cotton on the Moon!  Scissors will also be necessary for hair cuts.  That's another steel item.  As for security guards, perhaps they will have steel swords and batons made of cast basalt. 
Mechanical air purification will augment crops and algae to maintain oygen levels in habitations.  CO2 electrolysis and Sabatier reactors will be key to this.  At night under reduced illumination the crops will not grow as fast or generate as much oxygen. If they are cooled into "suspended animation" they won't return any oxygen to the air at all.  Engineers will have to determine whether it takes less energy to run mechanical air purification systems by night or less energy to illuminate the crops to regenerate oxygen from CO2.  In either case, power must be stored up for nightspan in the form of H2 and O2 for fuel cells, flywheels, and/or batteries.  Eventually a lunar power grid will feed power from day side to nite side.
HYDROGEN FULLY RECYCLED
ALL OXYGEN IS RECOVERED FROM CO2
breathed in by animals
Plants are central to LSS.  They provide food, recycle CO2 to O2, and transpire water into the air.  Plants will grow best in soil from sieved regolith fertilized with a combination of liquid plant nutrients and compost.  Real soil, rather than hydroponics, makes nutrients more bioavailable to crops.  Microbes secrete "glues" that hold roots in and microbes make nutrients more bioavailable to the crops. 

Nature contains a vast reservoir of organic material undergoing decay and releasing CO2 slowly back into the air.  We can't have a vast reservoir of decaying material on the Moon, so we must burn some of the methane from anaerobic digestors in fuel cells back to CO2 and we must burn some of the waste in wet oxidizers back to CO2 to keep CO2 levels up for the crops. But we want to have some compost too for good rich soil that plants grow better in than in hydroponics or soil that is only chemically fertilized.
hey, barbeque charcoal