Better (read Bad ass) Loc

Greatly improved loc and loc tools, a fix to the field constants file, some other minor bug fixes.