The purchase of an important listed building in St Ives has been completed on behalf of a company set up with help from the Coastal Communities Fund.