1.6.4 rewrite

Rewrite of working 1.6.4 mod, merging to this repo