Add modal backend functionality & fix npm build system