Replaces PHP commands by JS scripts.
Fixes #361.