JavaScript Shamir Secret Sharing