Refine time stamp comparison, add a test

Add a test of the index.lock removal code, and fix the time stamp comparisons so that they don't fail due to the 1 second granularity of file system times and the millisecond granularity of the getCurrentTimeMillis() call.