Refactored common functions into fslocate/common

postgres, sqlite and boyer impls all use this now.