Reimplement JSON support, cleanup syntax; Set chapter lengths properly