Fixes to preloader, fixes to drawing library, and changed around code structure for gemswap