[core][build][js] fix several issues, better debugging information, create RegExp at runtime instead of preprocessing them at build