Megamasers: Theory and Applications