FSpiNN: An Optimization Framework for Memory-Efficient and Energy-Efficient Spiking Neural Networks