Rearranging library code pt1. Also changed style to mimic iOS a little bit
Moved partially UI related code out of library and into app.js