Encode typesig() to JSON & Add Z3 support for specs