Replace octave examples with Javascript implementations