protected String readAsKeyVal(BufferedReader reader, String expectedKey)
			throws IOException {
		String line = reader.readLine();
		while (line.isEmpty() || line.indexOf("#") == 0) {
			line = reader.readLine();
		}
		if (line.indexOf("#") > 0) {
			line = line.substring(0, line.indexOf("#")).trim();
		}
		int split = line.indexOf(":");
		String key = line.substring(0, split);
		String value = line.substring(split + 1);
		if (!expectedKey.equals(key)) {
			throw new IllegalArgumentException("Expected key " + expectedKey
					+ ", got " + key);
		}
		return value;
	}