general cleanup: rm unused config.h, add license info to device.c/h, add a couple compiler options and fix warnings