Library - step one

First step. Moving, refactoring code so the 608 stands as much as
possible on its own (no more global variables & functions)