Add spinlock_trylock routine; use it to implement spinlock_lock
Refactor pk, bbl, machine into separate libraries Yuck.