Retro Game Jam 2014 changes

added support of multiple states on a same line using offsetX. A single state must stand on one line, but multiple state can be on the same line, contrary to before
end callback before "nextstate" check to avoid callback not being called
added safety checks and sanitized values (added default values where possible)
added ability to draw a sprite with a scale
added facility function GetFrameDimension