NeuroMAS: Multi-Agent Systems as Neural Networks with Joint Reinforcement Learning