Ported all functions from Fire Red. Cleaned up useful.h
Merge remote-tracking branch 'upstream/master'