AngularJS implementation of Ronald Rivest's elegant sampling algorithm