Fix javac warnings

 * Use superseding classes/methods instead of the deprecated ones
 * Suppress unchecked warnings where applicable