Write function for name expiration.

Write a separate function for calculating name expiration counters and
checking for expiration of a name.  Use it instead of inline
calculations in BlockChain.cpp.