add a base_url variable.
cleanup
divers fixes.