Moved all the Calculator code to lib/