Smart Environments and their Applications to Cultural Heritage