Make project build without warnings

Added some #[allow(dead_code)] some places to the functions that
needs to stay, but generate 'dead code' warnings on test- or normal
build. Also fixed other misc. warnings.