Update to version 1.4

Rewrite of JS code + several minor fixes