You will have to apply for all your visas and things before you leave the US as you are not allowed to enter the UK as a visitor and then switch to a different visa. If you are moving to the UK, you have to enter the country with the visa in your passport.
If you are in the US, you will have to apply online for your visa - the online form is on the UK visa website (
http://www.ukvisas.gov.uk/en/howtoapply/). It is the same form for all applications, so you just choose the correct visa from the drop down menu.
If you have been married and living together outside the UK for 4 years or more (which you have), there are two options:
1) You apply for a spousal visa with an endorsement on it saying 'KOL required'. This means that once you arrive in the UK on the spousal visa, you can then take the Life in the UK test (KOL) whenever you are ready and apply for ILR as soon as you have passed it, instead of having to wait until you have been in the UK for two years.
2) If you have the time/money, before you apply for a visa you can fly to the UK as a visitor and take the Life in the UK test while you are there. Then, you fly back to the US and apply directly for ILE (Indefinite Leave to Enter) without having to get a spousal visa first.
(Edited to add: x-posted with WebyJ)