tile functions
REBASE ME
Port more of Robs tile stuff to clj