Support opening books
Some refactoring
Added mach specific timer funcionality