An open-source multi-purpose N-body code for collisional dynamics