Major revision, made class use less static, defined constants, fixed memory issues, added overloaded add_field, and tweaks