Added support for per-tag json updates. Also some pep8 cleanup