[canshark] Rewritten to have shared code for canshark and canshark-gui