Fix typechecking the hhi files

Summary: Fixes facebook/hhvm#3036

Sed.

Reviewed By: @JoelMarcey

Differential Revision: D1403524
Refactor cell and type arith for shift operators

Summary: They were just handwritten in several areas, this finally adds
{cell,type}Sh{l,r} to match the other functions.

Also changes the returns on some of the type-arith functions from
TInitCell in the worst case to TInitPrim.

Reviewed By: @jdelong

Differential Revision: D1380563
Fixed error output for json_encode

Summary: `json_encode` threw a notice instead of setting a json error, this caused several discrepencies including forgotten implementaion of `JSON_PARTIAL_OUTPUT_ON_ERROR`.

Reviewed By: fredemmott, ptarjan

Differential Revision: D1393135