Small cleanup of source

Removes some unused stuff and marks appropriate stuff as const.