[counter] Add shebang / license, clean up a bit