N-body simulation in JavaScript and Canvas