JRE 6 Compatibility

Changed JRE build dependencies to JRE 6 instead of 7. This meant
replacing casts from Object -> bool/int with Boolean/Integer, and
replacing every switch(string) statement with horrendous if/else chains.