Changed several function and parameter signatures to add const to things