Analysis and Design of Analog Front-end Circuitry for Avalanche Photodiodes (APD) and Silicon Photo-multipliers (SiPM) in Time-of-flight Applications