Attempt to update JS client for P+R, K+R and B+R

The attempt failed miserably. :(
Hopefully this code can serve as a basis for further development efforts.