moved tweet function to another file, improved API a bit, fixed small bugs