Refactor device-proxy to something packagable and standalone