viewer.py cleanup and fixes. Now writes all particle data not just pos.