closes #61
Merge with master and bluetooth branch. Fix merging conflicts