Break #signature out into own method for perf

As calculating the signature requires reading the whole file, this won't
be a constant time operation. Therefore, be more lazy about it and only
calculate it when necessary.