Fix includes and resolve nupic build issues

@rhyolight - This should fix the nupic build.
@oxtopus - Please review.