Added ctypes wrapper and custom libmagic module.
Updated modules/plugins to use ctypes wrapper classes.