How did Samuel Morse finally get enough money to test his inventions?